﻿using Ex04.Menus.Interfaces;
using Ex04.Menus.Test.Interface_Testing;

namespace Ex04.Menus.Test
{
    public static class InterfaceTester
    {
        public static void Test()
        {
            MainMenu mainMenu = new MainMenu("My Menu");

            Action1 action1 = new Action1();

            MenuItem menuItem1 = new MenuItem("Sub-Menu 2");
            Action3 action3 = new Action3();
            menuItem1.AddMenuItem(action3);
            MenuItem menuItem3 = new MenuItem("Sub-Menu 2-2");
            menuItem1.AddMenuItem(menuItem3);
            Action4 action4 = new Action4();
            menuItem3.AddMenuItem(action4);
            Action5 action5 = new Action5();
            menuItem3.AddMenuItem(action5);
            Action6 action6 = new Action6();
            menuItem3.AddMenuItem(action6);
            MenuItem menuItem2 = new MenuItem("Sub-Menu 3");
            Action7 action7 = new Action7();
            menuItem2.AddMenuItem(action7);
            Action8 action8 = new Action8();
            menuItem2.AddMenuItem(action8);
            
            Action2 action2 = new Action2();

            // add sub-menus to main menu created earlier
            mainMenu.AddMenuItem(action1);
            mainMenu.AddMenuItem(menuItem1);
            mainMenu.AddMenuItem(menuItem2);
            mainMenu.AddMenuItem(action2);

            mainMenu.Show();
        }
    }
}
